package com.example.springbootmvc.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@RequestMapping("/test2")
@RestController
public class TestController2 {

    @RequestMapping("/getname")
    public String getName(HttpServletRequest request) {
        return "Name: " + request.getParameter("name");
    }

    @RequestMapping("/getname2")
    public String getName2(String name) {
        return "Name: " + name;
    }

    @RequestMapping("/getname3")
    public String getName3(String name,Integer age) {
        return "Name: " + name + " age:" + age;
    }


}
